package com.yuxi.shuzu;

import java.util.Scanner;

public class Demo7 {
    public static void main(String[] args) {
        int i = getNum();
        System.out.println("该数字出现了" + i+"次");
    }

    public static int getNum() {
        int[] arr = {3,4,3,5,7,9};
        Scanner input = new Scanner(System.in);
        System.out.println("给定一个数字");
        int x = input.nextInt();
        int count = 0;
        for (int i : arr) {
            if (i==x){
                count++;
            }
        }
        return count;
    }
}
